
//
//  LSTeamLineupViewController.m
//  LookScore
//
//  Created by wr on 2018/4/20.
//  Copyright © 2018年 ChongQingXunTiCompany. All rights reserved.
//

#import "LSTeamLineupViewController.h"
#import "UIViewController+ZJScrollPageController.h"
#import "LSPulldDownOptionsView.h"//下拉view
#import "LSTeamDetailCell.h"

@interface LSTeamLineupViewController ()<UITableViewDelegate,UITableViewDataSource>

@property(strong,nonatomic)UITableView *tableView;

@property(strong,nonatomic)LSPulldDownOptionsView *pullView;

@property(strong,nonatomic)UIButton *categoryBu;

@end

@implementation LSTeamLineupViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor whiteColor];
    // Do any additional setup after loading the view.
}

-(void)zj_viewDidLoadForIndex:(NSInteger)index{
//    self.tableView.tableHeaderView = [self tableHeadView];
    [self.view addSubview:self.tableView];
    
    //    [self loadTeamHandicapData];
}
- (void)loadTeamHandicapData{
    
    //    MyLog(@"leagueId --- %@ /n season --- %@",self.leagueId,self.season);
    [LSHttpEnclosureTool GET:LSLeagueIntegral parameters:@{@"leagueId":@"36",@"matchSeason":@"2017-2018"} resBlock:^(id responseObject) {
        if (responseObject) {
            MyLog(@"leagueTable ---- %@",responseObject);
        }
    }];
}

#pragma mark 🔥 tableViewDelegate tableViewDataSource

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 9;
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 35;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return 35;
}

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, LSScreenWidth, 45)];
    headerView.backgroundColor = LSSubGrayColorf7;
    
    NSInteger width = (LSScreenWidth - 20)/5;
    NSArray *array = @[@"号码",@"姓名",@"国际",@"位置",@"年龄"];
    for (int i = 0; i < 5; i ++) {
        UILabel *lable = [UILabel new];
        lable.text = array[i];
        lable.textColor = LSTitleGrayColor3;
        lable.font=LSFontSize12;
        lable.textAlignment = NSTextAlignmentCenter;
        [headerView addSubview:lable];
        lable.sd_layout.leftEqualToView(headerView).offset(10+i*width).topEqualToView(headerView).widthIs(width).heightIs(34);
    }
    
    return headerView;
}

- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    LSTeamLineupCell *cell=[LSTeamLineupCell TeamLineupCellByTableView:tableView];
    if (indexPath.row % 2 == 0) {
        cell.backgroundColor = LSSubGrayColorf7;
    }
    else{
        cell.backgroundColor = [UIColor whiteColor];
    }
    return cell;
}
#pragma mark 🔥 Getter
-(UITableView *)tableView{
    if (!_tableView) {
        _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, LSScreenWidth, LSScreenHeight) style:UITableViewStyleGrouped];
        _tableView.delegate = self;
        _tableView.dataSource = self;
        _tableView.sectionHeaderHeight = 10;
        _tableView.sectionFooterHeight = 0;
        _tableView.backgroundColor =LSBackGroundColor;
        _tableView.showsVerticalScrollIndicator = NO;
        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    }
    return _tableView;
}

@end
